package com.example.mybatisplus.demo.easypoi.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.example.mybatisplus.demo.easypoi.enums.SexEnum;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>人员</p>
 *
 * @author slfx
 */
@Data
public class Member {

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 姓名
     */
  //  @Excel(name = "姓名", width = 15, desensitizationRule = "1,3", orderNum = "1")
    @Excel(name = "姓名", width = 15, orderNum = "1", mergeVertical = true)
    @Length(max = 2, message = "长度最多为2位")
    private String name;

    /**
     * 身份证号码
     */
    @Excel(name = "身份证号码", width = 20, desensitizationRule = "6_4", groupName = "详细信息", orderNum = "3")
    private String cardNo;

    /**
     * 公司
     */
    @Excel(name = "公司", width = 40, orderNum = "2", mergeVertical = true, mergeRely = {0})
  //  @Excel(name = "公司", width = 40, orderNum = "2")
    private String companyName;


    /**
     * 电子邮箱
     */
    @Excel(name = "电子邮箱", width = 40, desensitizationRule = "1~@", groupName = "详细信息", orderNum = "5" )
    private String email;

    /**
     * 手机号码
     */
    @Excel(name = "手机号码", width = 20, desensitizationRule = "3_4" , groupName = "详细信息", orderNum = "6")
    private String phoneNumber;

    /**
     * 性别，0-男 1-女
     */
    @Excel(name = "性别", replace = {"男_0","女_1"}, groupName = "详细信息", orderNum = "7", addressList = true)
    private String gender;

    /**
     * 性别2，0-男 1-女
     */
    @Excel(name = "性别2", groupName = "详细信息", orderNum = "8",
            enumExportField = "name", enumImportMethod = "getByName")
    private SexEnum sex;

    /**
     * 生日
     */
    @Excel(name = "生日", width = 15, format = "yyyy-MM-dd", groupName = "详细信息", orderNum = "8")
    private Date birthday;

    /**
     * 工资
     */
    @Excel(name = "薪资", type = 10, width = 20, numFormat = "##0.000", orderNum = "9")
    @Max(value = 6000, message = "不能超过6000")
    private BigDecimal salary;

}
